package controlLayer;
import modelLayer.*;

public class LoanCtrl {
     private LoanContainer loanContainer;
    
    public LoanCtrl() {
        loanContainer = LoanContainer.getInstance();
    }
    
    public void createLoan(Person p, Dvd d, int id, String borrowDate, String period) {
        Loan loan = new Loan(p, d, id, borrowDate, period);
        loanContainer.addLoan(loan);
    }
    
    public Loan findLoan(int id) {
        Loan loan = loanContainer.findLoan(id);
        return loan;
    }
    
    public void returnLoan(Loan l) {
        l.setState("returned");
    }
    
}
